package com.example.controller;


import javax.servlet.http.HttpServletRequest;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class BaseController{
	private static String name="1";
	private static String pass="123";
	@RequestMapping("/")
	public String index() {
		return "index";
	}
	@RequestMapping("/main")
	public String login(String username, String password, HttpServletRequest request) {
		System.out.println("用户名"+username+"\t密码"+password); 
		if(username.equals(name) && password.equals(pass)) {
			return "main";
		}
		else {
			return "error";
		}
	}
}
